\begin{algorithm}
\caption{MinimalEquivalentEdgeSet($P_i$,$P_j$,$E_{P_i,P_j}$)}
\label{alg:minimalEES}
\begin{algorithmic}[1]
%\REQUIRE{The total number of transactoins $|T|$ and mimimal support level $\alpha$}
\STATE $E^R_{P_i,P_j}=\emptyset$
\WHILE{$E_{P_i,P_j}\neq \emptyset$}
     \STATE $v^\prime\rightarrow min(\{v|(u,v) \in E_{P_i,P_j}\})$  \COMMENT{the first vertex in $P_j$ that $P_i$ can reach} 
     \STATE $u^\prime \leftarrow max(\{u|(u,v^\prime) \in E_{P_i,P_j}\})$ 
     \STATE $E^R_{P_i,P_j} \leftarrow E^R_{P_i,P_j} \cup \{(u^\prime,v^\prime)\}$
     \STATE $E_{P_i,P_j} \leftarrow   E_{P_i,P_j} \backslash \{(u,v) \in E_{P_i,P_j} | u \preceq   u^\prime \}$ \COMMENT{Remove all edges which cross $(u^\prime,v^\prime)$}
\ENDWHILE
\STATE return $E^R_{P_i,P_j}$ \\
\end{algorithmic}
\end{algorithm}